package copyengine.ui.dragdrop.impl.animation
{
	import copyengine.ui.dragdrop.IDragDropSource;

	import flash.display.MovieClip;

	public class CEFrameButtonDragDropCoreAnimation implements IDragDropTargetCoreAnimation
	{
		private static const ROLL_OUT_FRAME:int = 1;
		private static const ROLL_OVER_FRAME:int = 2;

		private var target:MovieClip;

		public function CEFrameButtonDragDropCoreAnimation()
		{
		}

		public function setTarget(_target:MovieClip):void
		{
			target = _target;
		}

		public function onSourceEnter(_source:IDragDropSource):void
		{
			target.gotoAndStop(ROLL_OVER_FRAME);
		}

		public function onSourceLeave(_source:IDragDropSource):void
		{
			target.gotoAndStop(ROLL_OUT_FRAME);
		}

		public function onSourceDrop(_source:IDragDropSource, _x:Number, _y:Number):void
		{
			target.gotoAndStop(ROLL_OUT_FRAME);
		}

		public function dispose():void
		{
			target = null;
		}
	}
}